<template>
    <div>
        <el-dialog title="编辑" :visible="isShowEditDialog" width="430px" @close="dialogClose">
            <el-form ref="editForm" :model="formFileds" label-width="55px" :rules="rules">
                <el-form-item label="日期">
                    <el-date-picker v-model="formFileds.date" value-format="yyyy-MM-dd" :editable="false"
                        :clearable="false">
                    </el-date-picker>
                </el-form-item>
                <el-form-item label="姓名" prop="name">
                    <el-input v-model="formFileds.name"></el-input>
                </el-form-item>
                <el-form-item label="地址" prop="address">
                    <el-input v-model="formFileds.address"></el-input>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" class="pull-right margin-l-25">确定
                    </el-button>
                    <el-button @click="dialogClose" class="pull-right">取消</el-button>
                </el-form-item>
            </el-form>
        </el-dialog>
    </div>
</template>

<script>
export default {
    //接受父组件
    props:{
        record:{
            type:Object
        },
        isShowEditDialog:{
            type:Boolean
        }
    },
    

    data() {
        return {
            formFileds: {
            date: '',
            name: '',
            address: '',
            id: ''
          },
          rules: {
            name: [{
              required: true,
              message: '姓名不能为空',
              trigger: 'blur, change'
            }],
            address: [{
              required: true,
              message: '地址不能为空',
              trigger: 'blur, change'
            }]
          },
        }
    },
    methods:{
        dialogClose(){ 
            this.$emit('dialogClose')
        },
        handleEdit(e){
            alert(e)
        },

    },
    mounted(){
        console.log(this.record)
        this.formFileds=this.record
    }
}
</script>

<style lang="less" scoped>

</style>